﻿#ifndef GRAPHICSITEM_H
#define GRAPHICSITEM_H

#include <QGraphicsPolygonItem>

class QGraphicsItem;
class QGraphicsScene;
class QGraphicsSceneMouseEvent;
class QPointF;

class GraphicsItem : public QGraphicsPolygonItem
{
public:
    enum EType
    {
        Type = UserType + 1
    };

    enum EGraphicsType
    {
        Box,
        Triangle
    };

    explicit GraphicsItem(EGraphicsType graphicsType, QGraphicsItem *item = 0);

    EGraphicsType diagramType() const
    {
        return polygon() == boxPolygon ? Box : Triangle;
    }

    int type() const
    {
        return Type;
    }

private:
    QPolygonF boxPolygon;
    QPolygonF trianglePolygon;
};

#endif
